package serializable;

import java.io.*;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/5/15
 * 方式二：transient 瞬态修饰符，适合大量的需求
 */

public class User2 implements Serializable {
    private static final long serialVersionUID = -8491175514338144822L;
    private String name;
    private int age;
    private String gender;
    private transient String password;

    private String address;
    public User2() {
    }
    public User2(String name, int age, String gender, String password, String address) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.password = password;
        this.address = address;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(int age) {
        this.age = age;
    }

    /**
     * 获取
     * @return gender
     */
    public String getGender() {
        return gender;
    }

    /**
     * 设置
     * @param gender
     */
    public void setGender(String gender) {
        this.gender = gender;
    }

    /**
     * 获取
     * @return password
     */
    public String getPassword() {
        return password;
    }

    /**
     * 设置
     * @param password
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 获取
     * @return address
     */
    public String getAddress() {
        return address;
    }

    /**
     * 设置
     * @param address
     */
    public void setAddress(String address) {
        this.address = address;
    }
    public String toString() {
        return "User{name = " + name + ", age = " + age + ", gender = " + gender + ", password = " + password + ",  address = " + address + "}";
    }


}

